
-- ----------------------------
--  Table structure for AppUser
-- ----------------------------
DROP TABLE IF EXISTS AppUser;
CREATE TABLE AppUser (
  appUserId bigint(20) NOT NULL,
  userName varchar(255) DEFAULT NULL COMMENT '用户名',
  password varchar(255) DEFAULT NULL COMMENT '密码',
  createdBy varchar(255) DEFAULT NULL,
  createdOn datetime DEFAULT NULL,
  modifiedBy varchar(255) DEFAULT NULL,
  modifiedOn datetime DEFAULT NULL,
  isObsoleteDate date DEFAULT NULL,
  PRIMARY KEY (appUserId)
);

-- ----------------------------
--  Records of AppUser
-- ----------------------------
BEGIN;
INSERT INTO AppUser VALUES ('0', 'admin', 'admin', null, null, null, null, null);
COMMIT;

-- ----------------------------
--  Table structure for AppUserPermission
-- ----------------------------
DROP TABLE IF EXISTS AppUserPermission;
CREATE TABLE AppUserPermission (
  appUserPermissionId bigint(20) NOT NULL,
  appUserId bigint(20) NOT NULL COMMENT '用户ID',
  permissionId bigint(20) NOT NULL COMMENT '权限ID',
  createdBy varchar(255) DEFAULT NULL,
  createdOn datetime DEFAULT NULL,
  modifiedBy varchar(255) DEFAULT NULL,
  modifiedOn datetime DEFAULT NULL,
  isObsoleteDate datetime DEFAULT NULL,
  PRIMARY KEY (appUserPermissionId)
);

-- ----------------------------
--  Records of AppUserPermission
-- ----------------------------
BEGIN;
INSERT INTO AppUserPermission VALUES ('0', '0', '0', null, null, null, null, null);
COMMIT;

-- ----------------------------
--  Table structure for IdGenerator
-- ----------------------------
DROP TABLE IF EXISTS IdGenerator;
CREATE TABLE IdGenerator (
  GEN_TABLE_NAME varchar(255) NOT NULL,
  ID int(11) NOT NULL AUTO_INCREMENT,
  GEN_TABLE_VALUE bigint(20) NOT NULL,
  PRIMARY KEY (ID)
);

-- ----------------------------
--  Table structure for News
-- ----------------------------
DROP TABLE IF EXISTS News;
CREATE TABLE News (
  newsId bigint(20) NOT NULL,
  newsNo varchar(255) DEFAULT NULL COMMENT '新闻编号',
  newsTitle varchar(255) DEFAULT NULL COMMENT '新闻标题',
  newsStatus tinyint(1) DEFAULT NULL COMMENT '审核状态',
  newsContent longtext COMMENT '新闻内容',
  newsDate datetime DEFAULT NULL COMMENT '新闻日期',
  isTop tinyint(1) DEFAULT NULL COMMENT '是否置顶',
  languageId bigint(20) DEFAULT NULL,
  createdBy varchar(255) DEFAULT NULL,
  createdOn datetime DEFAULT NULL,
  modifiedBy varchar(255) DEFAULT NULL,
  modifiedOn datetime DEFAULT NULL,
  isObsoleteDate datetime DEFAULT NULL,
  PRIMARY KEY (newId)
);

-- ----------------------------
--  Table structure for Permission
-- ----------------------------
DROP TABLE IF EXISTS Permission;
CREATE TABLE Permission (
  permissionId bigint(20) NOT NULL,
  permissionName varchar(255) DEFAULT NULL COMMENT '权限名字',
  permissionDesc varchar(255) DEFAULT NULL COMMENT '权限描述',
  createdBy varchar(255) DEFAULT NULL,
  createdOn datetime DEFAULT NULL,
  modifiedBy varchar(255) DEFAULT NULL,
  modifiedOn datetime DEFAULT NULL,
  isObsoleteDate date DEFAULT NULL,
  PRIMARY KEY (permissionId)
);

-- ----------------------------
--  Records of Permission
-- ----------------------------
BEGIN;
INSERT INTO Permission VALUES ('0', 'ADMIN', 'ADMIN', null, null, null, null, null);
COMMIT;

-- ----------------------------
--  Table structure for Product
-- ----------------------------
DROP TABLE IF EXISTS Product;
CREATE TABLE Product (
  productId bigint(20) NOT NULL,
  productNo varchar(255) DEFAULT NULL COMMENT '产品编号',
  productModel varchar(255) DEFAULT NULL COMMENT '产品型号',
  productName varchar(255) DEFAULT NULL COMMENT '产品名字',
  productCategoryId bigint(20) DEFAULT NULL COMMENT '产品类别',
  productStatus tinyint(1) DEFAULT NULL COMMENT '审核状态',
  productContent longtext COMMENT '产品详细描述',
  productDate datetime DEFAULT NULL COMMENT '产品日期',
  isTop tinyint(1) DEFAULT NULL COMMENT '是否置顶',
  languageId bigint(20) DEFAULT NULL,
  createdBy varchar(255) DEFAULT NULL,
  createdOn datetime DEFAULT NULL,
  modifiedBy varchar(255) DEFAULT NULL,
  modifiedOn datetime DEFAULT NULL,
  isObsoleteDate datetime DEFAULT NULL,
  PRIMARY KEY (productId)
);

-- ----------------------------
--  Table structure for ProductCategory
-- ----------------------------
DROP TABLE IF EXISTS ProductCategory;
CREATE TABLE ProductCategory (
  productCategoryId bigint(20) NOT NULL,
  categoryName varchar(255) NOT NULL COMMENT '产品类别名',
  categoryType tinyint(4) DEFAULT NULL COMMENT '类别分类',
  categoryParentId bigint(20) DEFAULT NULL COMMENT '父类别',
  languageId bigint(20) DEFAULT NULL,
  createdBy varchar(255) DEFAULT NULL,
  createdOn datetime DEFAULT NULL,
  modifiedBy varchar(255) DEFAULT NULL,
  modifiedOn datetime DEFAULT NULL,
  isObsoleteDate datetime DEFAULT NULL,
  PRIMARY KEY (productCategoryId)
);


-- ----------------------------
--  Table structure for Language
-- ----------------------------
DROP TABLE IF EXISTS Language;
CREATE TABLE Language (
  languageId bigint(20) NOT NULL,
  languageName varchar(10) NOT NULL COMMENT 'Chinese, English',
  languageKey varchar(10) DEFAULT NULL COMMENT 'zh_CN, en_US',
  createdBy varchar(255) DEFAULT NULL,
  createdOn datetime DEFAULT NULL,
  modifiedBy varchar(255) DEFAULT NULL,
  modifiedOn datetime DEFAULT NULL,
  isObsoleteDate datetime DEFAULT NULL,
  PRIMARY KEY (languageId)
);

-- ----------------------------
--  Records of Permission
-- ----------------------------
BEGIN;
INSERT INTO Language VALUES ('1', 'English', 'en', null, null, null, null, null);
INSERT INTO Language VALUES ('2', 'Chinese', 'zh_HK', null, null, null, null, null);
COMMIT;